import Router from 'koa-router'
import { validator } from '../middleware/common.middleware.ts'
import {
  getClockinAllow,
  updateClockinAllow,
} from '../controller/clockin.controller.ts'

const router = new Router({ prefix: '/clockin' })

// 获取手机卡流量信息
router.get('/getClockinAllow', getClockinAllow)

// 更新手机卡流量信息
router.post(
  '/updateClockinAllow',
  validator({
    allow: { type: 'string', min: 1, max: 1, required: true },
    allowEmailNotice: { type: 'string', min: 1, max: 1, required: false },
  }),
  updateClockinAllow,
)

export default router
